﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml;

namespace aucn.web.thai
{
    public partial class ScenicSpots : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Master.Attributes["submenu"] = "ThailandNav";
            if (Request.QueryString["sitename"] != null)
            {
                this.GetSite(Request.QueryString["sitename"]);
            }
        }

        protected void GetSite(string siteName)
        {
            System.Threading.Thread.Sleep(500);
            Response.Expires = -1;

            Response.ContentType = "application/xml";
            XmlDocument doc = new XmlDocument();
            try
            {
                doc.Load(Server.MapPath("~/App_Data/thaitour.xml"));
                XmlNode node = doc.DocumentElement.SelectSingleNode("site[@name='" + siteName + "']");
                Response.Write(string.Format("<site>{0}</site>", node.InnerXml));
            }
            catch { Response.Write(""); }

            //Response.Write("<hello>" + DateTime.Now.ToString()+"</hello>");
            Response.End();
        }
    }
}
